home *** CD-ROM | disk | FTP | other *** search
/ NetNews Offline 2 / NetNews Offline Volume 2.iso / news / comp / lang / c++-part1 / 4972 < prev    next >
Mailbox/MIME Entity  |  1996-08-06  |  1.6 KB

open in: MacOS 8.1     |     Win98     |     DOS

browse contents    |     view JSON data     |     view as text


This file was processed as: Mailbox/MIME Entity (archive/mbox).

ConfidenceProgramDetectionMatch TypeSupport
100% dexvert Newsgroup Content (archive/news) magic Supported
100% dexvert Mailbox/MIME Entity (archive/mbox) magic Supported
100% dexvert Internet Message Format (text/imf) magic Supported
1% dexvert Text File (text/txt) fallback Supported
100% file news, ASCII text default
100% checkBytes Printable ASCII default
100% dexmagic PrintFox/Pagefox WEAK default
100% perlTextCheck Likely Text (Perl) default
100% siegfried fmt/950 MIME Email (1.0) default
100% detectItEasy Format: plain text[LF] default (weak)
100% xdgMime message/news default



hex view
+--------+-------------------------+-------------------------+--------+--------+
|00000000| 50 61 74 68 3a 20 6f 64 | 69 2e 63 6f 6d 21 75 73 |Path: od|i.com!us|
|00000010| 65 6e 65 74 0a 46 72 6f | 6d 3a 20 4b 69 6d 62 65 |enet.Fro|m: Kimbe|
|00000020| 72 6c 65 79 20 42 75 72 | 63 68 65 74 74 20 3c 62 |rley Bur|chett <b|
|00000030| 75 72 63 68 65 74 74 3e | 0a 4e 65 77 73 67 72 6f |urchett>|.Newsgro|
|00000040| 75 70 73 3a 20 63 6f 6d | 70 2e 6c 61 6e 67 2e 63 |ups: com|p.lang.c|
|00000050| 2c 63 6f 6d 70 2e 6c 61 | 6e 67 2e 63 2b 2b 0a 53 |,comp.la|ng.c++.S|
|00000060| 75 62 6a 65 63 74 3a 20 | 52 65 3a 20 49 6e 63 72 |ubject: |Re: Incr|
|00000070| 65 6d 65 6e 74 69 6e 67 | 20 65 6e 75 6d 65 72 61 |ementing| enumera|
|00000080| 74 65 64 20 74 79 70 65 | 73 0a 44 61 74 65 3a 20 |ted type|s.Date: |
|00000090| 31 20 46 65 62 20 31 39 | 39 36 20 32 31 3a 34 34 |1 Feb 19|96 21:44|
|000000a0| 3a 30 38 20 47 4d 54 0a | 4f 72 67 61 6e 69 7a 61 |:08 GMT.|Organiza|
|000000b0| 74 69 6f 6e 3a 20 53 6f | 66 74 77 61 72 65 20 4c |tion: So|ftware L|
|000000c0| 65 76 65 72 61 67 65 2c | 20 49 6e 63 0a 4d 65 73 |everage,| Inc.Mes|
|000000d0| 73 61 67 65 2d 49 44 3a | 20 3c 34 65 72 63 37 38 |sage-ID:| <4erc78|
|000000e0| 24 67 30 62 40 6d 61 73 | 74 65 72 6d 69 6e 64 2e |$g0b@mas|termind.|
|000000f0| 6f 64 69 2e 63 6f 6d 3e | 0a 52 65 66 65 72 65 6e |odi.com>|.Referen|
|00000100| 63 65 73 3a 20 3c 41 6e | 64 79 2e 4c 61 77 2d 33 |ces: <An|dy.Law-3|
|00000110| 31 30 31 39 36 31 31 33 | 38 33 31 30 30 30 31 40 |10196113|8310001@|
|00000120| 70 63 30 37 33 34 2e 72 | 69 2e 62 62 73 72 63 2e |pc0734.r|i.bbsrc.|
|00000130| 61 63 2e 75 6b 3e 0a 4e | 4e 54 50 2d 50 6f 73 74 |ac.uk>.N|NTP-Post|
|00000140| 69 6e 67 2d 48 6f 73 74 | 3a 20 6c 6f 6f 6e 2e 6f |ing-Host|: loon.o|
|00000150| 64 69 2e 63 6f 6d 0a 4d | 69 6d 65 2d 56 65 72 73 |di.com.M|ime-Vers|
|00000160| 69 6f 6e 3a 20 31 2e 30 | 0a 43 6f 6e 74 65 6e 74 |ion: 1.0|.Content|
|00000170| 2d 54 79 70 65 3a 20 74 | 65 78 74 2f 70 6c 61 69 |-Type: t|ext/plai|
|00000180| 6e 3b 20 63 68 61 72 73 | 65 74 3d 75 73 2d 61 73 |n; chars|et=us-as|
|00000190| 63 69 69 0a 43 6f 6e 74 | 65 6e 74 2d 54 72 61 6e |cii.Cont|ent-Tran|
|000001a0| 73 66 65 72 2d 45 6e 63 | 6f 64 69 6e 67 3a 20 37 |sfer-Enc|oding: 7|
|000001b0| 62 69 74 0a 58 2d 4d 61 | 69 6c 65 72 3a 20 4d 6f |bit.X-Ma|iler: Mo|
|000001c0| 7a 69 6c 6c 61 20 31 2e | 31 4e 20 28 58 31 31 3b |zilla 1.|1N (X11;|
|000001d0| 20 49 3b 20 53 75 6e 4f | 53 20 34 2e 31 2e 33 20 | I; SunO|S 4.1.3 |
|000001e0| 73 75 6e 34 63 29 0a 54 | 6f 3a 20 41 6e 64 79 2e |sun4c).T|o: Andy.|
|000001f0| 4c 61 77 40 62 62 73 72 | 63 2e 61 63 2e 75 6b 0a |Law@bbsr|c.ac.uk.|
|00000200| 58 2d 55 52 4c 3a 20 6e | 65 77 73 3a 41 6e 64 79 |X-URL: n|ews:Andy|
|00000210| 2e 4c 61 77 2d 33 31 30 | 31 39 36 31 31 33 38 33 |.Law-310|19611383|
|00000220| 31 30 30 30 31 40 70 63 | 30 37 33 34 2e 72 69 2e |10001@pc|0734.ri.|
|00000230| 62 62 73 72 63 2e 61 63 | 2e 75 6b 0a 0a 41 6e 64 |bbsrc.ac|.uk..And|
|00000240| 79 2e 4c 61 77 40 62 62 | 73 72 63 2e 61 63 2e 75 |y.Law@bb|src.ac.u|
|00000250| 6b 20 28 41 6e 64 79 20 | 4c 61 77 29 20 77 72 6f |k (Andy |Law) wro|
|00000260| 74 65 3a 0a 3e 49 73 20 | 69 74 20 6c 65 67 61 6c |te:.>Is |it legal|
|00000270| 20 74 6f 20 69 6e 63 72 | 65 6d 65 6e 74 20 61 6e | to incr|ement an|
|00000280| 20 65 6e 75 6d 65 72 61 | 74 65 64 20 74 79 70 65 | enumera|ted type|
|00000290| 3f 20 49 20 68 61 76 65 | 20 61 6e 20 65 6e 75 6d |? I have| an enum|
|000002a0| 65 72 61 74 65 64 20 6c | 69 73 74 20 6f 66 0a 3e |erated l|ist of.>|
|000002b0| 70 6f 73 73 69 62 6c 65 | 20 64 6f 63 75 6d 65 6e |possible| documen|
|000002c0| 74 20 74 79 70 65 73 20 | 74 68 61 74 20 49 20 77 |t types |that I w|
|000002d0| 61 6e 74 20 74 6f 20 73 | 74 65 70 20 74 68 72 6f |ant to s|tep thro|
|000002e0| 75 67 68 2c 20 61 6e 64 | 20 6d 79 20 63 6f 6d 70 |ugh, and| my comp|
|000002f0| 69 6c 65 72 20 69 73 0a | 3e 62 61 72 66 69 6e 67 |iler is.|>barfing|
|00000300| 20 6f 6e 20 69 74 2e 20 | 49 74 20 73 65 65 6d 73 | on it. |It seems|
|00000310| 20 73 75 63 68 20 61 20 | 77 61 73 74 65 20 6f 66 | such a |waste of|
|00000320| 20 61 6e 20 65 6e 75 6d | 65 72 61 74 69 6f 6e 20 | an enum|eration |
|00000330| 69 66 20 49 20 68 61 76 | 65 20 74 6f 20 72 65 73 |if I hav|e to res|
|00000340| 6f 72 74 0a 3e 74 6f 20 | 69 6e 74 73 20 74 6f 20 |ort.>to |ints to |
|00000350| 67 65 74 20 74 68 69 73 | 20 64 6f 6e 65 2e 0a 3e |get this| done..>|
|00000360| 0a 3e 41 6c 74 65 72 6e | 61 74 69 76 65 6c 79 20 |.>Altern|atively |
|00000370| 64 6f 65 73 20 61 6e 79 | 6f 6e 65 20 68 61 76 65 |does any|one have|
|00000380| 20 61 20 73 75 67 67 65 | 73 74 69 6f 6e 20 61 73 | a sugge|stion as|
|00000390| 20 74 6f 20 68 6f 77 20 | 74 6f 20 64 6f 20 74 68 | to how |to do th|
|000003a0| 69 73 20 6b 69 6e 64 20 | 6f 66 0a 3e 74 68 69 6e |is kind |of.>thin|
|000003b0| 67 20 6c 65 67 61 6c 6c | 79 3f 0a 3e 0a 3e 66 6f |g legall|y?.>.>fo|
|000003c0| 72 20 28 45 6e 75 6d 65 | 72 61 74 65 64 54 79 70 |r (Enume|ratedTyp|
|000003d0| 65 20 65 49 6e 64 65 78 | 20 3d 20 65 6e 75 6d 5f |e eIndex| = enum_|
|000003e0| 66 69 72 73 74 3b 20 65 | 49 6e 64 65 78 20 3c 20 |first; e|Index < |
|000003f0| 65 6e 75 6d 5f 6c 61 73 | 74 3b 20 65 49 6e 64 65 |enum_las|t; eInde|
|00000400| 78 2b 2b 29 20 7b 0a 3e | 20 20 20 20 20 20 20 20 |x++) {.>| |
|00000410| 20 20 20 20 20 20 20 20 | 20 20 20 20 20 20 20 20 | | |
|00000420| 20 20 20 20 20 20 20 20 | 20 20 20 20 20 20 20 20 | | |
|00000430| 20 20 20 20 20 20 20 20 | 20 20 20 20 20 20 20 20 | | |
|00000440| 20 20 20 20 20 5e 5e 5e | 5e 5e 5e 5e 5e 0a 3e 20 | ^^^|^^^^^.> |
|00000450| 20 20 20 2f 2a 20 64 6f | 20 73 6f 6d 65 74 68 69 | /* do| somethi|
|00000460| 6e 67 20 2a 2f 0a 3e 7d | 0a 0a 20 20 45 6e 75 6d |ng */.>}|.. Enum|
|00000470| 73 20 61 72 65 20 63 6f | 6e 73 74 61 6e 74 73 20 |s are co|nstants |
|00000480| 61 6e 64 20 68 61 76 65 | 20 6e 6f 20 6d 61 74 68 |and have| no math|
|00000490| 20 73 65 6d 61 6e 74 69 | 63 73 2e 20 20 42 75 74 | semanti|cs. But|
|000004a0| 20 79 6f 75 20 63 61 6e | 20 63 6f 6e 76 65 72 74 | you can| convert|
|000004b0| 0a 65 6e 75 6d 73 20 74 | 6f 20 69 6e 74 73 20 28 |.enums t|o ints (|
|000004c0| 61 6c 74 68 6f 75 67 68 | 20 6e 6f 74 20 76 69 63 |although| not vic|
|000004d0| 65 20 76 65 72 73 61 29 | 2e 20 20 54 72 79 20 72 |e versa)|. Try r|
|000004e0| 65 70 6c 61 63 69 6e 67 | 20 45 6e 75 6d 65 72 61 |eplacing| Enumera|
|000004f0| 74 65 64 54 79 70 65 0a | 77 69 74 68 20 69 6e 74 |tedType.|with int|
|00000500| 20 2d 2d 20 79 6f 75 20 | 63 61 6e 20 69 6e 63 72 | -- you |can incr|
|00000510| 65 6d 65 6e 74 20 74 68 | 65 20 69 6e 74 20 61 6e |ement th|e int an|
|00000520| 64 20 63 6f 6d 70 61 72 | 65 20 69 74 20 74 6f 20 |d compar|e it to |
|00000530| 65 6e 75 6d 5f 66 69 72 | 73 74 20 61 6e 64 0a 65 |enum_fir|st and.e|
|00000540| 6e 75 6d 5f 6c 61 73 74 | 2e 20 20 48 6f 77 65 76 |num_last|. Howev|
|00000550| 65 72 2c 20 79 6f 75 20 | 77 6f 6e 27 74 20 62 65 |er, you |won't be|
|00000560| 20 61 62 6c 65 20 74 6f | 20 70 61 73 73 20 65 49 | able to| pass eI|
|00000570| 6e 64 65 78 20 74 6f 20 | 61 6e 79 20 66 75 6e 63 |ndex to |any func|
|00000580| 74 69 6f 6e 0a 65 78 70 | 65 63 74 69 6e 67 20 45 |tion.exp|ecting E|
|00000590| 6e 75 6d 65 72 61 74 65 | 64 54 79 70 65 20 77 2f |numerate|dType w/|
|000005a0| 6f 20 65 78 70 6c 69 63 | 69 74 6c 79 20 63 61 73 |o explic|itly cas|
|000005b0| 74 69 6e 67 20 69 74 2e | 0a 0a 20 20 49 20 68 61 |ting it.|.. I ha|
|000005c0| 76 65 20 6e 65 76 65 72 | 20 68 61 64 20 61 20 70 |ve never| had a p|
|000005d0| 72 6f 62 6c 65 6d 20 77 | 69 74 68 20 74 68 65 20 |roblem w|ith the |
|000005e0| 73 65 6d 61 6e 74 69 63 | 73 20 6f 66 20 65 6e 75 |semantic|s of enu|
|000005f0| 6d 73 2c 20 61 6e 64 20 | 68 61 76 65 20 0a 65 76 |ms, and |have .ev|
|00000600| 65 6e 20 66 6f 75 6e 64 | 20 69 74 20 75 73 65 66 |en found| it usef|
|00000610| 75 6c 20 74 68 61 74 20 | 79 6f 75 20 63 61 6e 27 |ul that |you can'|
|00000620| 74 20 63 6f 6e 76 65 72 | 74 20 69 6e 74 2d 3e 65 |t conver|t int->e|
|00000630| 6e 75 6d 2e 20 20 49 66 | 20 79 6f 75 27 72 65 0a |num. If| you're.|
|00000640| 72 75 6e 6e 69 6e 67 20 | 69 6e 74 6f 20 70 72 6f |running |into pro|
|00000650| 62 6c 65 6d 73 2c 20 79 | 6f 75 20 6d 69 67 68 74 |blems, y|ou might|
|00000660| 20 63 6f 6e 73 69 64 65 | 72 20 75 73 69 6e 67 20 | conside|r using |
|00000670| 61 20 64 69 66 66 65 72 | 65 6e 74 20 69 64 69 6f |a differ|ent idio|
|00000680| 6d 2e 0a 0a 4b 69 6d 62 | 65 72 6c 65 79 0a 0a |m...Kimb|erley.. |
+--------+-------------------------+-------------------------+--------+--------+